{extend name="public/base" /}
{block name="body"}
<div class="ibox float-e-margins">
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li><strong>会员统计</strong></li>
	</ol>
</div>
	<div class="ibox-content">
		<form id="myForm" class="form-horizontal m-t" method="post" action="{:url('index')}">
			<div class="order-info panel panel-default">
				<div class="panel-heading">
					<strong><i class="fa fa-bar-chart" style="color:#f70;"></i>&nbsp;&nbsp;会员比例统计</strong>&nbsp;&nbsp;
				</div>
				<div class="panel-body clearfix">
					<div class="info-group">
						<span class="h4">
							{$ptmember}
						</span>
						<span class="info-description">普通会员</span>
					</div>
					<div class="info-group">
						<span class="h4">
							{$dlmember}
						</span>
						<span class="info-description">代理商</span>
					</div>
					<div class="info-group">
						<span class="h4">
							{$hhmember}
						</span>
						<span class="info-description">合伙人</span>
					</div>	
					<div class="info-group">
						<span class="h4">
							{$sum}
						</span>
						<span class="info-description">总计</span>
					</div>
				</div>
			</div>	
			<!--统计图-->
			<div id="main" style="width: 100%;height:400px;"></div>
       </form>    
	</div>
</div>
{/block} {block name="script"}
<script src="__JS__/jquery.form.js"></script>
<script src="__LIB__/validate/jquery.validate.min.js"></script>
<script src="__LIB__/validate/messages_zh.min.js"></script>
<script src="__LIB__/validate/add_validate.min.js"></script>
<script src="__LIB__/fileinput/js/fileinput.min.js"></script>
<script src="__LIB__/fileinput/js/locales/zh.js"></script>
<script src="__JS__/echarts.common.min.js"></script>
<style>
	.order-info .info-group{width:25%; text-align:center; float:left;}
	.order-info .info-group+.info-group{border-left:1px dotted #ccc; }
	.h4{font-size:22px; display:block;}
	
	
</style>
<script>
	var myChart = echarts.init(document.getElementById('main'));

	option = {
    title : {
        text: '会员比例统计',
        subtext: '实时统计',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        left: 'left',
        data: ['普通会员','代理商','合伙人']
    },
    series : [
        {
            name: '商城会员比例统计',
            type: 'pie',
            radius : '55%',
            center: ['50%', '60%'],
            data:[
                {value:{$ptmember}, name:'普通会员'},
                {value:{$dlmember}, name:'代理商'},
                {value:{$hhmember}, name:'合伙人'}
            ],
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};

	    myChart.setOption(option);
</script>
{/block}